<?php

/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2017/6/21
 * Time: 15:31
 */
namespace ElementVip\JwOms\Models;

use Illuminate\Database\Eloquent\Model;

class OmsSyncLog extends Model
{
    protected $table = 'el_oms_sync_log';
    protected $guarded = ['id'];

    public function setSuccessMessageAttribute($value)
    {
        $this->attributes['success_message'] = json_encode($value);
    }
    
    public function setFailedMessageAttribute($value)
    {
        $this->attributes['failed_message'] = json_encode($value);
    }
    
    public function getSuccessMessageAttribute()
    {
        return json_decode($this->attributes['success_message']);
    }
    
    public function getFailedMessageAttribute()
    {
        return json_decode($this->attributes['failed_message']);
    }
}